import Vue from "vue";
import Router from "vue-router";


Vue.use(Router)

export const constantRouterMap = [

    {
        path: '/404',
        component: () => import('@/views/404'),
        hidden: true
    },
    {
        path: '/',
        component: () => import('@/views/index'),
        name: 'index',
        hidden: false,
        meta: {keepAlive: true}
    },
    {
        path: '/buy',
        component: () => import('@/views/buy'),
        name: 'buy',
        hidden: false,
    },
    {
        path: '/message',
        component: () => import('@/views/message'),
        name: 'message',
        hidden: false,
    },
    {
        path: '/accredit',
        component: () => import('@/views/accredit'),
        name: 'accredit',
        hidden: false,
    },
    {
        path: '/accredit/list',
        component: () => import('@/views/accredit/list'),
        name: 'accreditlist',
        hidden: false,
    },
    {
        path: '/register',
        component: () => import('@/views/register'),
        name: 'register',
        hidden: false,
    },
    {
        path: '/registerDetail',
        component: () => import('@/views/register/detail'),
        name: 'registerDetail',
        hidden: false,
    },
    {path: '*', redirect: '/404', hidden: true}
];

export default new Router({
    // mode: 'history', //后端支持可开
    scrollBehavior: () => ({y: 0}),
    routes: constantRouterMap
})

